/*
 * @Author: LG
 * @Date: 2020-09-20 10:05:43
 * @Description: 
 * @Last Modified By: LG
 * @Last Modified Time: 2020-09-20 11:26:55
 */
import React, { useReducer } from 'react';
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
import App from '../App';
import Home from '../views/Home';
import NotFound from '../views/NotFound';
import reduxApp from '../container/app'
import { initialState, reducer } from '../stories';
import Provider from './Provider';
import Page from '../mobxContainer';
const Routes: React.FC = () => {
    const [state,dispatch] = useReducer(reducer,initialState)
    return (
        <Provider store={{ state, dispatch }}>
            <Router>
                <Switch>
                    <Route path="/login" component={App} />
                    <Route path="/" exact component={Home} />
                    <Route path="/404" component={NotFound} />
                    <Route path="/Redux" component={reduxApp} />
                    <Route path="/mobx" component={Page} />
                     <Redirect path="/index" to="/"></Redirect>
                    <Redirect path="*" to="/404"></Redirect>
                </Switch>
            </Router>
        </Provider>
    );
    

};
export default Routes;
